package com.iotek.ssm.controller;

import com.iotek.ssm.pojo.CustomQueryVo;
import com.iotek.ssm.pojo.EmployeeStatus;
import com.iotek.ssm.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/employee")
public class EmployeeController {

    @Autowired
    private EmployeeService employeeService;

    @RequestMapping("/employees")
    @ResponseBody
    public List<EmployeeStatus> employees(CustomQueryVo customQueryVo){
        List<EmployeeStatus> employees = null;
        try {
            employees = employeeService.findStatusList(customQueryVo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return employees;
    }
}
